package com.kzw.test.service;

import org.apache.commons.dbutils.QueryRunner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kzw.test.model.User;

@Service
@Transactional
public class UserService2 {

	@Autowired
	private QueryRunner runner;
	
	public void save(User user) throws Exception {
		String sql = "insert into tb_user3(name, age) values(?,?)";
		runner.update(sql, user.getName(), user.getAge());
		
		// throw new RuntimeException("运行时异常");
	}
}
